<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

<ui:composition>
    <p:panel id="pnlClientPhone" header="Clientes" widgetVar="panelClientPhone">

        <p:dataTable id="dataTableClientPhone" var="clientPhone" value="#{clientDashboardMBean.listClientPhone}" rowKey="#{clientPhone.pkClientPhone}" selection="#{clientDashboardMBean.selectedClientPhone}"
                     selectionMode="single" paginator="true" rows="10" dynamic="true" paginatorPosition="top" update="panel_edit_client_phone">

            <p:column>
                <f:facet name="header">Name</f:facet>
                <h:outputText value="#{clientPhone.name}"/>
            </p:column>

            <p:column sortBy="#{clientPhone.phone}">
                <f:facet name="header">Telefone</f:facet>
                <h:outputText value="#{clientPhone.phone}"/>
            </p:column>
        </p:dataTable>

        <p:commandButton id="btnCreateClientPhone" value="Criar" styleClass="btn" onclick="create_client_phone.show()"/>
        <p:commandButton id="btnEditClientPhone" value="Editar" styleClass="btn" onclick="edit_client_phone.show()"/>
        <p:commandButton id="btnRemoveClientPhone" value="Apagar" styleClass="btn" actionListener="#{clientDashboardMBean.removeClientPhone}" update="pnlClientPhone"/>
    </p:panel>
</ui:composition>
</html>